//package com.example.hello;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class HttpServer {
    public static void main(String[] args) throws IOException {
        // 监听8888端口
        ServerSocket serverSocket=new ServerSocket(8888);
        System.out.println("server is running...");
        while(true){
            Socket socket=serverSocket.accept();// 监听
            System.out.println("connected from " + socket.getRemoteSocketAddress());
            Thread t = new Handler(socket);
            t.start();
        }
    }
}

